/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package SwingAnimation;

import java.util.Timer;
import java.util.TimerTask;

/**
 *
 * @author Heather
 */
public class AnimationAnimator extends TimerTask
{

  private AnimationInterface toAnimate;
  Timer t;

  public AnimationAnimator(AnimationInterface toAnimate)
  {
    this.toAnimate = toAnimate;
  }

  public void run()
  {
    if (toAnimate.showNextAnimation())
    {
      toAnimate.paintAnimation();
    }
  }
}
